<?php
/**
 *  view: part view search results
 *  File: search/search_results
 */

       
        if( isset($users) && count($users)>0 )
        {
          foreach ($users as $row)
          {
            if( $row->image_name != NULL )            
              $image = "<img src='".base_url()."ajax/image/thumb/{$row->id}/{$row->image_name}' alt='{$row->username}' width='100' height='100' >";            
            else
              $image = "<img src='".base_url()."img/no_photo.gif' alt='' width='100' height='100' >";
            //$name = ( $row->name != "" )?$row->name:$row->username;
            $name = $row->username;
            $link = base_url()."profile/view-profile/{$row->username}.htm";
            echo "
                
              <div class='search-list'><a href='{$link}'>{$image}<span>{$name}</span></a></div>

            ";
          }
        }
        
?>
        
        <div class="clr"></div>               
        <p id="contentspaginate" class="paginationstyle pagination" align="center">
          Página: <a href="#" rel="previous" class="imglinks"><<  </a> &nbsp; <select></select> &nbsp; <a href="#" rel="next"> >></a>
       </p>
       <script language='javascript' >
          var contents_home=new virtualpaginate({
              piececlass: "search-list",
              piececontainer: 'div', 
              pieces_per_page: 18,
              defaultpage: 0,
              wraparound: false,
              persist: false
          })

          contents_home.buildpagination(["contentspaginate"]);
        </script>	
